#include <iostream>
using namespace std;

int main()
{
    const int a = 5;
    int b = 10;
    // int *P = &a;
    const int *P = &a;
    cout << *P << endl;
    P = &b;
    // 错误写法，不要将 const 类型强转
    // int *P = (int*)&a;
    // *P = 7;
    cout << *P << endl;
    cout << a << endl;

    int * const p = &b;
    *p = 11;
    // p 地址被 const 修饰，不能修改
    // p = &a;
    return 0;
}